package tr.edu.ege.kipler.syntax;

import java.util.HashMap;
import java.util.Map;

import tr.edu.ege.kipler.common.Copyable;

/**
 * 
 * @author İnanç Seylan
 *
 */
public abstract class ModalOperator implements Copyable<ModalOperator> {
	private Map<String, Object> keyValueMap = new HashMap<String, Object>();

	public void setParameter(String param, Object value) {
		keyValueMap.put(param, value);
	}

	public Object getParameter(String param) {
		return keyValueMap.get(param);
	}

	@Override
	public boolean equals(Object obj) {
		if (obj != null && (obj.getClass().equals(this.getClass()))) {
			ModalOperator other = (ModalOperator) obj;
			return keyValueMap.equals(other.keyValueMap);
		}
		return false;
	}

	@Override
	public int hashCode() {
		return keyValueMap.hashCode();
	}

	abstract public boolean isNecessiate();

	abstract public ModalOperator getDual();

}
